<template>
<div>
    <h3>当前的count值为：{{this.$store.state.count}}</h3>
    <button @click="add">+1</button>
</div>
</template>

<script>
    export default {
        name: 'Addition',
        data(){
            return{
                x:this.$store.state.count
            }
        },
        methods:{
            add(){
                this.$store.commit('add')
            }
        }
    };
</script>

<style scoped>

</style>
